//
//  WatersCenterCell.m
//  Water
//
//  Created by yh on 2017/12/1.
//  Copyright © 2017年 chenguibang. All rights reserved.
//

#import "WatersCenterCell.h"
#import <UserCenterManager.h>
#import <SDWebImage/UIImageView+WebCache.h>
@implementation WatersCenterCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void)setUserBaseinfo:(UserBaseinfo *)userBaseinfo{
    _userBaseinfo = userBaseinfo;
    self.name.text = userBaseinfo.nickname;
    [self.img sd_setImageWithURL:[NSURL URLWithString:userBaseinfo.avatar]];
}

- (void)setUserId:(NSString *)userId{
    _userId = userId;
    [[UserCenterManager shared] getUserInfoWithUserId:self.userId reuslt:^(UserInfo *userInfo) {
        self.name.text = userInfo.nickname;
        [self.img sd_setImageWithURL:[NSURL URLWithString:userInfo.avatar]];
    }];
}

@end
